package com.haokanma.show;


import com.haokanma.show.activity.BaseActivity;
import com.haokanma.show.activity.LoginActivity;
import com.haokanma.show.activity.register.RegisterActivity;

import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;

public class MainActivity extends BaseActivity implements OnClickListener {

	private LinearLayout mLinearCtrlbar;
	private Button mBtnRegister;
	private Button mBtnLogin;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

	/* (non-Javadoc)
	 * @see android.view.View.OnClickListener#onClick(android.view.View)
	 */
	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {

		case R.id.welcome_btn_register:
			startActivity(RegisterActivity.class);
			break;

		case R.id.welcome_btn_login:
			startActivity(LoginActivity.class);
			break;

		}
	}

	/* (non-Javadoc)
	 * @see com.haokanma.show.activity.BaseActivity#initViews()
	 */
	@Override
	protected void initViews() {
		// TODO Auto-generated method stub
		mLinearCtrlbar = (LinearLayout) findViewById(R.id.welcome_linear_ctrlbar);
		mBtnRegister = (Button) findViewById(R.id.welcome_btn_register);
		mBtnLogin = (Button) findViewById(R.id.welcome_btn_login);
	}

	/* (non-Javadoc)
	 * @see com.haokanma.show.activity.BaseActivity#initEvents()
	 */
	@Override
	protected void initEvents() {
		// TODO Auto-generated method stub
		mBtnRegister.setOnClickListener(this);
		mBtnLogin.setOnClickListener(this);
	}

}
